package test01;

import java.lang.reflect.Array;
import java.util.Arrays;

public class MyStack {

    int[] elm;
    int usedSize;

    public MyStack() {
        elm = new int[10];
    }
    public void push(int x) {

        if(isFull()){
            this.elm = Arrays.copyOf(this.elm, this.elm.length * 2);
        }
        elm[usedSize] = x;
    }
    public boolean isFull(){
        return usedSize == elm.length;
    }
}
